﻿@model ManufacturerModel
@inject Grand.Services.Security.IPermissionService permissionService
@{
    //has "Manage Documents" permission?
    var canManageDocuments = await permissionService.Authorize(Grand.Services.Security.StandardPermissionProvider.ManageDocuments);
}
<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />
<admin-tabstrip name="manufacturer-edit">
    <items>
        <tabstrip-item text="@T("Admin.Catalog.Manufacturers.Info")" tab-index="0">
            <content>
                <div>
                    <partial name="_CreateOrUpdate.TabInfo" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Common.SEO")" tab-index="1">
            <content>
                <div>
                    <partial name="_CreateOrUpdate.TabSeo" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Catalog.Manufacturers.Products")" tab-index="2">
            <content>
                <div>
                    <partial name="_CreateOrUpdate.TabProducts" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Catalog.Manufacturers.Discounts")" tab-index="3">
            <content>
                <div>
                    <partial name="_CreateOrUpdate.TabDiscounts" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Catalog.Manufacturers.Acl")" tab-index="4">
            <content>
                <div>
                    <partial name="_TabAcl" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Catalog.Manufacturers.Stores")" tab-index="5">
            <content>
                <div>
                    <partial name="_TabStores" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        @if (canManageDocuments)
        {
            <tabstrip-item text="@T("Admin.Catalog.Manufacturers.Documents")" tab-index="6">
                <content>
                    <div>
                        <partial name="_CreateOrUpdate.TabDocuments" model="Model" />
                    </div>
                </content>
            </tabstrip-item>
        }
        <tabstrip-item text="@T("Admin.Common.GenericAttributes.Tab")" tab-index="7">
            <content>
                <div>
                    @{
                        ViewData["ObjectType"] = "Manufacturer";
                        ViewData["TabIndex"] = 7;
                    }
                    <partial name="_GenericAttributes" model="Model" view-data="ViewData" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Catalog.Manufacturers.ActivityLog")" tab-index="8">
            <content>
                <div>
                    <partial name="_CreateOrUpdate.TabActivityLog" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <vc:admin-widget widget-zone="manufacturer_details_tabs" additional-data="Model" />
    </items>
</admin-tabstrip>
